<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      let ajax = (method, ulr, data) => {
        return new Promise((resolve, reject) => {
          var request = new XMLHttpRequest();
          request.open(method, url);
          request.onreadystatechange = function () {
            if (request.readyState == 4) {
              if (request.response.status == 200) {
                resovle.call(null, request.response);
              } else {
                reject.call(null, request);
              }
            }
          };
          request.send(data);
        });
      };
      ajax("post", "http://xk.njpi/checkLogin.php", {
        username: "2206040120",
        password: "123456",
      }).then();
    </script>
  </body>
</html>
